﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GameServer
{
    public partial class MessageBOX : Form
    {
        Form1 mainform;
        public MessageBOX(Form1 form)
        {
            InitializeComponent();
            mainform = form;
        }

        private void MessageBOX_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                this.Visible = false;
                e.Cancel = true;
                Form1.messagelist = null;
                mainform.SetCheckBox(false);
            }
            catch (Exception ex)
            {
                Form1.DebugError(ex.ToString());
            }
        }
        //调试窗口添加信息
        public void AddMessage(string message)
        {
            try
            {
                this.listBox1.Items.Add(message);
            }
            catch(Exception ex)
            {
                Form1.DebugError(ex.ToString());
            }
        }
        //清空信息
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                this.listBox1.Items.Clear();
            }
            catch (Exception ex)
            {
                Form1.DebugError(ex.ToString());
            }
        }
    }
}
